import request from '@/utils/request'

// 部件属性

/**
 * 获取列表
 *
 * @export
 * @param {*} data { componentTypeId, page, pagesize }
 * @returns
 */
export function fetchComponentPropertiesFindPage(data) {
  return request({
    url: '/pc/base/componentProperties/findPage',
    method: 'post',
    data
  })
}

/**
 * 获取详情
 *
 * @export
 * @param {*} params { id }
 * @returns
 */
export function fetchComponentPropertiesGet(params) {
  return request({
    url: '/pc/base/componentProperties/get',
    method: 'get',
    params
  })
}

/**
 * 添加
 *
 * @export
 * @param {*} data { componentTypeId, options, promptText, propertyName, propertyType, required, sortNumber}
 * @returns
 */
export function fetchComponentPropertiesAdd(data) {
  return request({
    url: '/pc/base/componentProperties/add',
    method: 'post',
    data
  })
}

/**
 * 更新
 *
 * @export
 * @param {*} data { componentTypeId, options, promptText, propertyName, propertyType, required, sortNumber}
 * @returns
 */
export function fetchComponentPropertiesUpdate(data) {
  return request({
    url: '/pc/base/componentProperties/update',
    method: 'post',
    data
  })
}

/**
 * 删除
 *
 * @export
 * @param {*} data { id }
 * @returns
 */
export function fetchComponentPropertiesDelete(params) {
  return request({
    url: '/pc/base/componentProperties/delete',
    method: 'post',
    params
  })
}

